// // echarts x y轴数据获取
// export function initXYAxisDataList(dataList, xAxisKey, xAxisDataList, yAxisKey, yAxisDataList) {
//   const dataListLen = dataList.length
//   for (let idx = 0; idx < dataListLen; idx++) {
//     const data = dataList[idx]
//     xAxisDataList.push(data[xAxisKey])
//     yAxisDataList.push(data[yAxisKey])
//   }
// }
//
// // echarts x y变量值
// export function initXYlistToKeyIndex(xAxisDataList) {
//   const keyIdxCache = {}
//   for (const idx in xAxisDataList) {
//     keyIdxCache[xAxisDataList[idx]] = idx
//   }
//   return keyIdxCache
// }
//
// // echarts 对象分组
// export function initXYCycleDataList(dataList, cycleKey) {
//   const cycleData = {}
//   const dataListLen = dataList.length
//   for (let idx = 0; idx < dataListLen; idx++) {
//     const data = dataList[idx]
//     const cycleKeyVal = data[cycleKey]
//     if (cycleData[cycleKeyVal]) {
//       cycleData[cycleKeyVal].push(data)
//     } else {
//       const cycleKeyValList = []
//       cycleKeyValList.push(data)
//       cycleData[cycleKeyVal] = cycleKeyValList
//     }
//   }
//   return cycleData
// }
//
// // 取x轴数据
// export function getXAxisAllList(dataList, xAxisField) {
//   const xAxisAllList = []
//   const cycleData = initXYCycleDataList(dataList, xAxisField)
//   for (const key in cycleData) {
//     xAxisAllList.push(key)
//   }
//   return xAxisAllList
// }
//
// // 取合并x轴数据
// export function getXAxisMergeSortList(xAxisSortList, dataList, xAxisField) {
//   const xAxisAllList = getXAxisAllList(dataList, xAxisField)
//   const xAxisMergeList = Object.assign([], xAxisSortList)
//   const cache = initXYlistToKeyIndex(xAxisSortList)
//   const xAxisSortListLen = xAxisSortList.length
//   for (let i = 0; i < xAxisSortListLen; i++) {
//     const key = xAxisSortList[i]
//     if (!cache[key]) {
//       xAxisMergeList.push(key)
//     }
//   }
//   return xAxisMergeList
// }
//
// // 对echart 呈现顺序进行排序
// export function initXYAxisSortDataList(xAxisSortList, xAxisDataList, yAxisDataList) {
//   const keyIdxCache = initXYlistToKeyIndex(xAxisDataList)
//   const keyIdxDeleteCache = Object.assign({}, keyIdxCache)
//   const xAxisDataSortList = []
//   const yAxisDataSortList = []
//   const xAxisSortListLen = xAxisSortList.length
//   for (let idx = 0; idx < xAxisSortListLen; idx++) {
//     const xAxisSortKey = xAxisSortList[idx]
//     xAxisDataSortList.push(xAxisSortKey)
//     if (keyIdxCache[xAxisSortKey]) {
//       const i = keyIdxCache[xAxisSortKey]
//       yAxisDataSortList.push(yAxisDataList[i])
//       delete keyIdxDeleteCache[xAxisSortKey]
//     } else {
//       yAxisDataSortList.push(0)
//     }
//   }
//   for (key in keyIdxDeleteCache) {
//     const i = keyIdxDeleteCache.get(key)
//     xAxisDataSortList.push(key)
//     yAxisDataSortList.push(yAxisDataList.get(i))
//   }
//
//   xAxisDataList = Object.assign([], xAxisDataSortList)
//   yAxisDataList = Object.assign([], yAxisDataSortList)
// }
//
// export function getTimeSeriesList(dataList, seriesNameField, xAxisField, yAxisField, xAxisSortList) {
//   const xAxisSortNewList = getXAxisMergeSortList(xAxisSortList, demoList, xAxisField)
//   const seriesList = []
//   const legendData = []
//   const cycleData = initXYCycleDataList(demoList, seriesNameField)
//   for (const key in cycleData) {
//     const rowData = { name: '', data: [] }
//     const cycleList = cycleData[key]
//     const xAxisDataList = []
//     const yAxisDataList = []
//     const xAxisKey = xAxisField
//     const yAxisKey = yAxisField
//     initXYAxisDataList(cycleList, xAxisKey, xAxisDataList, yAxisKey, yAxisDataList)
//     initXYAxisSortDataList(xAxisSortNewList, xAxisDataList, yAxisDataList)
//     rowData.name = key
//     rowData.data = yAxisDataList
//     seriesList.push(rowData)
//     legendData.push(key)
//   }
//   const timeSeriesModel = { legendData: [], seriesList: [], xAxisDataList: [] }
//
//   timeSeriesModel.legendData = legendData
//   timeSeriesModel.seriesList = seriesList
//   timeSeriesModel.xAxisDataList = xAxisSortNewList
//   return timeSeriesModel
// }
